<?php
/**
 * @Notes:【】
 * @Date: 2022-08-10 21:46
 */

namespace App\Controller\Ocean;

use App\Middleware\AuthTokenMiddleware;
use App\Service\Ocean\OceanService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Middleware;
use Yj\Apidog\Annotation\ApiController;
use Yj\Apidog\Annotation\PostApi;

/**
 * @Middleware(AuthTokenMiddleware::class)
 * @ApiController(prefix="ocean")
 */
class OceanController extends BaseController
{
    /**
     * @Inject()
     * @var OceanService
     */
    protected $oceanService;

    /**
     * @Notes:【兑换】
     * @Date: 2022-08-10 21:48
     * @PostApi(path="user")
     */
    public function user()
    {
        $userId = $this->getUid();
        $data = $this->oceanService->getInfo($userId);
        $data = $data->setAttribute('ocean_exchange_power', systemConfig('ocean_exchange_power'));
        _SUCCESS($data);
    }
}